package com.charlotte.gupao.study.springbootrabbitmqdemo.delay;

import com.charlotte.gupao.study.springbootrabbitmqdemo.config.DelayQueueConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author junjie.ding
 * @date 2020/10/30 2:29
 * @description TODO
 */
@Component
@RabbitListener(queues = DelayQueueConfig.DELAYED_QUEUE_NAME)
public class DelayedMsgConsumer {

    @RabbitHandler
    public void process(Object msg){
        System.out.println("延迟队列收到消息时间：" + System.currentTimeMillis());
        System.out.println(" delayed queue received msg : " + msg);
    }
}
